package com.simpletour.qa.common.http;
/**
 * RESTful api 状态码
 * @author zhaohw
 * @date 2018-06-19 16:57
 */
public enum ResponseCode {

    /**
     * 操作成功
     */
    SUCCESS(0, ""),
    SERVER_INTERNAL_ERROR(50001,"server internal error"),
    SERVICE_INVOKE_ERROR(50002,"service invoke error"),

    JWT_NOT_EXIST(40301,"token is not present"),
    JWT_CHECK_ERROR(40302,"token check error"),
    JWT_PARAM_CHECK_ERROR(40303,"token param check error"),
    JWT_IS_EXPIRED(40304,"token is expired"),
    NO_AUTHORITY(40305,"no authority"),

    USER_NOT_EXIST(40401,"user not found"),
    USER_PASSWORD_ERROR(40402,"wrong password"),
    USER_FORBIDDEN(40403,"user has been forbidden"),
    USER_NAME_DUPLICATE(40404,"username duplicate"),
    USER_CAN_NOT_DELETE(40405,"you can't delete yourself"),

    PARAM_CHECK_ERROR(40001,"param check error"),

    RESOURCE_NOT_EXIST(405,"resource not exist"),
    ;

    int code;
    String error;

    ResponseCode(int code, String error) {
        this.code = code;
        this.error = error;
    }
}
